package com.example.abstractFactoryPattern.shape;

import com.example.abstractFactoryPattern.AbstractFactory;
import com.example.abstractFactoryPattern.color.Color;
import com.example.abstractFactoryPattern.color.ColorType;

import java.util.Objects;

/**
 * 形状生产工厂
 * sun 2017-11-23
 */
public abstract class ShapeFactory extends AbstractFactory{
    @Override
    public Shape getShape(ShapeType shapeType){
        if(Objects.isNull(shapeType)) return null;
        switch (shapeType){
            case CIRCLE:
                return new Circle();
            case RECTANGLE:
                return new Rectangle();
            case SQUARE:
                return new Square();
            default:
                    return null;
        }
    }
    @Override
    public  Color  getColor(ColorType colorType){
        return null;
    }
}
